package com.aivin.maproutelib.param;

import android.graphics.Bitmap;
import android.support.annotation.DrawableRes;
import com.amap.api.maps.model.LatLng;

public class MyMarkerOption {
    public LatLng latlng;
    private float anchorX = 0;
    private float anchorY = 0;
    private Bitmap bitmap;

    private int resId = -1;
    private boolean isDraggable = true;

    public MyMarkerOption(LatLng latlng) {
        this.latlng = latlng;
    }

    public MyMarkerOption icon(@DrawableRes int resId) {
        this.resId = resId;
        return this;
    }

    public MyMarkerOption icon(Bitmap bitmap) {
        this.bitmap = bitmap;
        return this;
    }

    public MyMarkerOption center() {
        anchorX = 0.5f;
        anchorY = 0.5f;
        return this;
    }


    public boolean hasResId() {
        return -1 != resId;
    }

    public int getResId() {
        return resId;
    }

    public Bitmap getBitmapIcon() {
        return bitmap;
    }

    public float getAnchorX() {
        return anchorX;
    }

    public float getAnchorY() {
        return anchorY;
    }


    public MyMarkerOption setDraggable(boolean isDraggable) {
        this.isDraggable = isDraggable;
        return this;
    }

    public boolean getDraggable() {
        return isDraggable;
    }

}
